<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Grafika\Gd\Editor | API</title>

            <link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/sami.css">
        <script src="../../js/jquery-1.11.1.min.js"></script>
        <script src="../../js/bootstrap.min.js"></script>
        <script src="../../js/typeahead.min.js"></script>
        <script src="../../sami.js"></script>
        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
    
    
    </head>

    <body id="class" data-name="class:Grafika_Gd_Editor" data-root-path="../../">
            <div id="content">
        <div id="left-column">
                <div id="control-panel">
                <form id="search-form" action="../../search.html" method="GET">
            <span class="glyphicon glyphicon-search"></span>
            <input name="search"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search">
        </form>
    </div>

                <div id="api-tree"></div>

        </div>
        <div id="right-column">
                <nav id="site-nav" class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="../../index.html">API</a>
            </div>
            <div class="collapse navbar-collapse" id="navbar-elements">
                <ul class="nav navbar-nav">
                    <li><a href="../../classes.html">Classes</a></li>
                                            <li><a href="../../namespaces.html">Namespaces</a></li>
                                        <li><a href="../../interfaces.html">Interfaces</a></li>
                    <li><a href="../../traits.html">Traits</a></li>
                    <li><a href="../../doc-index.html">Index</a></li>
                    <li><a href="../../search.html">Search</a></li>
                </ul>
            </div>
        </div>
    </nav>

                        <div class="namespace-breadcrumbs">
            <ol class="breadcrumb">
                <li><span class="label label-default">class</span></li>
                                                            <li><a href="../../Grafika.html">Grafika</a></li>
                                        <li><a href="../../Grafika/Gd.html">Gd</a></li>
    
                <li>Editor</li>
            </ol>
        </div>
                <div id="page-content">
                
    <div class="page-header">
        <h1>
            Editor
                
        </h1>
    </div>

    <p>    class
    <strong>Editor</strong>        implements
        <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
</p>

        
    

            <div class="description">
            <p>GD Editor class. Uses the PHP GD library.</p>                    </div>
    
    
    
    
            <h2>Methods</h2>

            <div class="container-fluid underlined">
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_apply">apply</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, <a href="../../Grafika/FilterInterface.html"><abbr title="Grafika\FilterInterface">FilterInterface</abbr></a> $filter)
        
                                            <p>Apply a filter to the image. See Filters section for a list of available filters.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_blend">blend</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image1, <a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image2, string $type = &#039;normal&#039;, float $opacity = 1.0, string $position = &#039;top-left&#039;, int $offsetX, int $offsetY)
        
                                            <p>Blend two images together with the first image as the base and the second image on top. Supports several blend modes.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    int
                </div>
                <div class="col-md-8 type">
                    <a href="#method_compare">compare</a>(string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image1, string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image2)
        
                                            <p>Compare two images and returns a hamming distance. A value of 0 indicates a likely similar picture. A value between 1 and 10 is potentially a variation. A value greater than 10 is likely a different image.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_crop">crop</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $cropWidth, int $cropHeight, string $position = &#039;center&#039;, int $offsetX, int $offsetY)
        
                                            <p>Crop the image to the given dimension and position.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_draw">draw</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, <a href="../../Grafika/DrawingObjectInterface.html"><abbr title="Grafika\DrawingObjectInterface">DrawingObjectInterface</abbr></a> $drawingObject)
        
                                            <p>Draw a DrawingObject on the image. See Drawing Objects section.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    bool
                </div>
                <div class="col-md-8 type">
                    <a href="#method_equal">equal</a>(string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image1, string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image2)
        
                                            <p>Compare if two images are equal. It will compare if the two images are of the same width and height. If the dimensions differ, it will return false. If the dimensions are equal, it will loop through each pixels. If one of the pixel don't match, it will return false. The pixels are compared using their RGB (Red, Green, Blue) values.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_fill">fill</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, <a href="../../Grafika/Color.html"><abbr title="Grafika\Color">Color</abbr></a> $color, int $x, int $y)
        
                                            <p>Fill entire image with color.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_flatten">flatten</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image)
        
                                            <p>Flatten if animated GIF. Do nothing otherwise.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_flip">flip</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, string $mode)
        
                                            <p>Flip or mirrors the image.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_free">free</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image)
        
                                            <p>Free the image clearing resources associated with it.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    static&nbsp;int
                </div>
                <div class="col-md-8 type">
                    <a href="#method_gdAlpha">gdAlpha</a>(float $alpha)
        
                                            <p>Convert alpha value of 0 - 1 to GD compatible alpha value of 0 - 127 where 0 is opaque and 127 is transparent</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    bool
                </div>
                <div class="col-md-8 type">
                    <a href="#method_isAvailable">isAvailable</a>()
        
                                            <p>Checks if the editor is available on the current PHP install.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_opacity">opacity</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, float $opacity)
        
                                            <p>Sets the image to the specified opacity level where 1.0 is fully opaque and 0.0 is fully transparent.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_open">open</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, string $imageFile)
        
                                            <p>Open an image file and assign Image to first parameter.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_resize">resize</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth, int $newHeight, string $mode = &#039;fit&#039;)
        
                                            <p>Wrapper function for the resizeXXX family of functions. Resize image given width, height and mode.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_resizeExact">resizeExact</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth, int $newHeight)
        
                                            <p>Resize image to exact dimensions ignoring aspect ratio. Useful if you want to force exact width and height.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_resizeExactHeight">resizeExactHeight</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newHeight)
        
                                            <p>Resize image to exact height. Width is auto calculated. Useful for creating row of images with the same height.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_resizeExactWidth">resizeExactWidth</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth)
        
                                            <p>Resize image to exact width. Height is auto calculated. Useful for creating column of images with the same width.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_resizeFill">resizeFill</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth, int $newHeight)
        
                                            <p>Resize image to fill all the space in the given dimension. Excess parts are cropped.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_resizeFit">resizeFit</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth, int $newHeight)
        
                                            <p>Resize image to fit inside the given dimension. No part of the image is lost.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_rotate">rotate</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $angle, <a href="../../Grafika/Color.html"><abbr title="Grafika\Color">Color</abbr></a>|null $color = null)
        
                                            <p>Rotate an image counter-clockwise.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_save">save</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, string $file, null|string $type = null, null|string $quality = null, bool $interlace = false, int $permission = 493)
        
                                            <p>Save the image to an image format.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_text">text</a>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, string $text, int $size = 12, int $x, int $y, <a href="../../Grafika/Color.html"><abbr title="Grafika\Color">Color</abbr></a> $color = null, string $font = &#039;&#039;, int $angle)
        
                                            <p>Write text to image.</p>                </div>
                <div class="col-md-2"></div>
            </div>
            </div>


        <h2>Details</h2>

            <div id="method-details">
                    <div class="method-item">
                    <h3 id="method_apply">
        <div class="location">at line         line 31</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>apply</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, <a href="../../Grafika/FilterInterface.html"><abbr title="Grafika\FilterInterface">FilterInterface</abbr></a> $filter)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Apply a filter to the image. See Filters section for a list of available filters.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td><a href="../../Grafika/FilterInterface.html"><abbr title="Grafika\FilterInterface">FilterInterface</abbr></a></td>
                <td>$filter</td>
                <td>Instance implementing the FilterInterface.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_blend">
        <div class="location">at line         line 57</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>blend</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image1, <a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image2, string $type = &#039;normal&#039;, float $opacity = 1.0, string $position = &#039;top-left&#039;, int $offsetX, int $offsetY)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Blend two images together with the first image as the base and the second image on top. Supports several blend modes.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image1</td>
                <td>The base image.</td>
            </tr>
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image2</td>
                <td>The image placed on top of the base image.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$type</td>
                <td>The blend mode. Can be: normal, multiply, overlay or screen.</td>
            </tr>
                    <tr>
                <td>float</td>
                <td>$opacity</td>
                <td>The opacity of $image2. Possible values 0.0 to 1.0 where 0.0 is fully transparent and 1.0 is fully opaque. Defaults to 1.0.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$position</td>
                <td>The position of $image2 on $image1. Possible values top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right and smart. Defaults to top-left.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$offsetX</td>
                <td>Number of pixels to add to the X position of $image2.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$offsetY</td>
                <td>Number of pixels to add to the Y position of $image2.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td>When added image is outside of canvas or invalid blend type</td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_compare">
        <div class="location">at line         line 152</div>
        <code>                    int
    <strong>compare</strong>(string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image1, string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image2)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Compare two images and returns a hamming distance. A value of 0 indicates a likely similar picture. A value between 1 and 10 is potentially a variation. A value greater than 10 is likely a different image.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image1</td>
                <td>Can be an instance of Image or string containing the file system path to image.</td>
            </tr>
                    <tr>
                <td>string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image2</td>
                <td>Can be an instance of Image or string containing the file system path to image.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>int</td>
            <td>Hamming distance. Note: This breaks the chain if you are doing fluent api calls as it does not return an Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_crop">
        <div class="location">at line         line 195</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>crop</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $cropWidth, int $cropHeight, string $position = &#039;center&#039;, int $offsetX, int $offsetY)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Crop the image to the given dimension and position.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$cropWidth</td>
                <td>Crop width in pixels.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$cropHeight</td>
                <td>Crop Height in pixels.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$position</td>
                <td>The crop position. Possible values top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right and smart. Defaults to center.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$offsetX</td>
                <td>Number of pixels to add to the X position of the crop.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$offsetY</td>
                <td>Number of pixels to add to the Y position of the crop.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_draw">
        <div class="location">at line         line 256</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>draw</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, <a href="../../Grafika/DrawingObjectInterface.html"><abbr title="Grafika\DrawingObjectInterface">DrawingObjectInterface</abbr></a> $drawingObject)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Draw a DrawingObject on the image. See Drawing Objects section.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td><a href="../../Grafika/DrawingObjectInterface.html"><abbr title="Grafika\DrawingObjectInterface">DrawingObjectInterface</abbr></a></td>
                <td>$drawingObject</td>
                <td>Instance of DrawingObject.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_equal">
        <div class="location">at line         line 277</div>
        <code>                    bool
    <strong>equal</strong>(string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image1, string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image2)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Compare if two images are equal. It will compare if the two images are of the same width and height. If the dimensions differ, it will return false. If the dimensions are equal, it will loop through each pixels. If one of the pixel don't match, it will return false. The pixels are compared using their RGB (Red, Green, Blue) values.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image1</td>
                <td>Can be an instance of Image or string containing the file system path to image.</td>
            </tr>
                    <tr>
                <td>string|<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image2</td>
                <td>Can be an instance of Image or string containing the file system path to image.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>bool</td>
            <td>True if equals false if not. Note: This breaks the chain if you are doing fluent api calls as it does not return an Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_fill">
        <div class="location">at line         line 338</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>fill</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, <a href="../../Grafika/Color.html"><abbr title="Grafika\Color">Color</abbr></a> $color, int $x, int $y)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Fill entire image with color.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td><a href="../../Grafika/Color.html"><abbr title="Grafika\Color">Color</abbr></a></td>
                <td>$color</td>
                <td>An instance of Grafika\Color class.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$x</td>
                <td>X-coordinate of start point.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$y</td>
                <td>Y-coordinate of start point.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_flatten">
        <div class="location">at line         line 361</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>flatten</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Flatten if animated GIF. Do nothing otherwise.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_flip">
        <div class="location">at line         line 392</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>flip</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, string $mode)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Flip or mirrors the image.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$mode</td>
                <td>The type of flip: 'h' for horizontal flip or 'v' for vertical.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_free">
        <div class="location">at line         line 405</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>free</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Free the image clearing resources associated with it.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_gdAlpha">
        <div class="location">at line         line 418</div>
        <code>        static            int
    <strong>gdAlpha</strong>(float $alpha)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Convert alpha value of 0 - 1 to GD compatible alpha value of 0 - 127 where 0 is opaque and 127 is transparent</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>float</td>
                <td>$alpha</td>
                <td>Alpha value of 0 - 1. Example: 0, 0.60, 0.9, 1</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>int</td>
            <td></td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_isAvailable">
        <div class="location">at line         line 431</div>
        <code>                    bool
    <strong>isAvailable</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Checks if the editor is available on the current PHP install.</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>bool</td>
            <td>True if available false if not.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_opacity">
        <div class="location">at line         line 456</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>opacity</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, float $opacity)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Sets the image to the specified opacity level where 1.0 is fully opaque and 0.0 is fully transparent.</p>                    <p>Warning: This function loops thru each pixel manually which can be slow. Use sparingly.</p>            </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>float</td>
                <td>$opacity</td>
                <td>The opacity level where 1.0 is fully opaque and 0.0 is fully transparent.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_open">
        <div class="location">at line         line 499</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>open</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, string $imageFile)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Open an image file and assign Image to first parameter.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$imageFile</td>
                <td>File system path to image file.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_resize">
        <div class="location">at line         line 515</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>resize</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth, int $newHeight, string $mode = &#039;fit&#039;)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Wrapper function for the resizeXXX family of functions. Resize image given width, height and mode.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newWidth</td>
                <td>Width in pixels.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newHeight</td>
                <td>Height in pixels.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$mode</td>
                <td>Resize mode. Possible values: "exact", "exactHeight", "exactWidth", "fill", "fit".</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_resizeExact">
        <div class="location">at line         line 555</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>resizeExact</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth, int $newHeight)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Resize image to exact dimensions ignoring aspect ratio. Useful if you want to force exact width and height.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newWidth</td>
                <td>Width in pixels.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newHeight</td>
                <td>Height in pixels.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_resizeExactHeight">
        <div class="location">at line         line 571</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>resizeExactHeight</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newHeight)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Resize image to exact height. Width is auto calculated. Useful for creating row of images with the same height.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newHeight</td>
                <td>Height in pixels.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_resizeExactWidth">
        <div class="location">at line         line 594</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>resizeExactWidth</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Resize image to exact width. Height is auto calculated. Useful for creating column of images with the same width.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newWidth</td>
                <td>Width in pixels.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_resizeFill">
        <div class="location">at line         line 618</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>resizeFill</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth, int $newHeight)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Resize image to fill all the space in the given dimension. Excess parts are cropped.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newWidth</td>
                <td>Width in pixels.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newHeight</td>
                <td>Height in pixels.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_resizeFit">
        <div class="location">at line         line 649</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>resizeFit</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $newWidth, int $newHeight)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Resize image to fit inside the given dimension. No part of the image is lost.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newWidth</td>
                <td>Width in pixels.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$newHeight</td>
                <td>Width in pixels.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_rotate">
        <div class="location">at line         line 681</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>rotate</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, int $angle, <a href="../../Grafika/Color.html"><abbr title="Grafika\Color">Color</abbr></a>|null $color = null)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Rotate an image counter-clockwise.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$angle</td>
                <td>The angle in degrees.</td>
            </tr>
                    <tr>
                <td><a href="../../Grafika/Color.html"><abbr title="Grafika\Color">Color</abbr></a>|null</td>
                <td>$color</td>
                <td>The Color object containing the background color.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_save">
        <div class="location">at line         line 717</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>save</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, string $file, null|string $type = null, null|string $quality = null, bool $interlace = false, int $permission = 493)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Save the image to an image format.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image. Saving the image to a different format will have NO effect on the Image instance.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$file</td>
                <td>File path where to save the image.</td>
            </tr>
                    <tr>
                <td>null|string</td>
                <td>$type</td>
                <td>The image format to use. Can be null, "gif", "png", or "jpeg". If null, an appropriate format will be chosen based on the output file name in $file.</td>
            </tr>
                    <tr>
                <td>null|string</td>
                <td>$quality</td>
                <td>Quality of image. Applies to JPEG only. Accepts number 0 - 100 where 0 is lowest and 100 is the highest quality. Or null for default. Default quality if null is 75.</td>
            </tr>
                    <tr>
                <td>bool</td>
                <td>$interlace</td>
                <td>Set to true for progressive JPEG. Applies to JPEG only. Default false.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$permission</td>
                <td>Default permission when creating non-existing target directory. Default is 0755. Note: Its using PHP's octal notation so you must prepend numbers with zero (0).</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_text">
        <div class="location">at line         line 780</div>
        <code>                    <a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a>
    <strong>text</strong>(<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a> $image, string $text, int $size = 12, int $x, int $y, <a href="../../Grafika/Color.html"><abbr title="Grafika\Color">Color</abbr></a> $color = null, string $font = &#039;&#039;, int $angle)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Write text to image.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
                <td>$image</td>
                <td>Instance of Image.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$text</td>
                <td>The text to be written.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$size</td>
                <td>The font size. Defaults to 12.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$x</td>
                <td>The distance from the left edge of the image to the left of the text. Defaults to 0.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$y</td>
                <td>The distance from the top edge of the image to the baseline of the text. Defaults to 12 (equal to font size) so that the text is placed within the image.</td>
            </tr>
                    <tr>
                <td><a href="../../Grafika/Color.html"><abbr title="Grafika\Color">Color</abbr></a></td>
                <td>$color</td>
                <td>The Color object. Default text color is black.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$font</td>
                <td>Full path to font file. If blank, will default to Liberation Sans font.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$angle</td>
                <td>Angle of text from 0 - 359. Defaults to 0.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/EditorInterface.html"><abbr title="Grafika\EditorInterface">EditorInterface</abbr></a></td>
            <td>An instance of Editor.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
            </div>

    
            </div>
                <div id="footer">
        Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>.
    </div>

        </div>
    </div>
    </body>

</html>
